module Pan
  class Toolbar < Pan::Component
    def render_on(html)
      html.div("id"=>"toolbar","style"=>{"background"=>"#D3D3D3 none repeat scroll 0%","bottom"=>"0pt","clear"=>"both","font-size"=>"10pt","left"=>"0pt","margin-top"=>"40px","padding"=>"0px 4px 0px 2px","position"=>"fixed","z-index"=>"20"}) {
        html.div("style"=>{"margin"=>"0px 6px 0px 0px", "float"=>"left"}) {
          html.img(:src=>"/img/pannonica.png",:style=>"margin:0;")
        }
        html.anchor(:href=>session.application_url) { 
          html.lit("New session")
        }
        html.text(" | ")
        html.link("Reload!") { 
          Session.reload
        }
        html.text(" | ")
        html.tag("a",{"href"=>"http://validator.w3.org/check/referer"}) { 
          html.lit("Validate") 
        }
        html.text(" | ")
        html.link("Inspectors") { 
          session.toggle_inspectors
        }
        html.lit(" (Sessions: #{session.application.active_sessions})")
      }
    end
  end
end
